<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jq unique</title>
    <script src="/jquery-3.2.1.js"></script>
    <script type="text/javascript">
        function sortNumber(a,b) {
            return a-b;
        }
        $(document).ready(function () {
            var a = new Array(5,5454,152,15,5,44,15,15,44);
            a.sort(sortNumber);
            $.unique(a);
            $.each(a,function (i,n) {
                document.write("元素{"+i+"}的值是："+n+"<br>");
            });
            document.close();
        });

    </script>
</head>

<body>
<h1>对数组进行排序去重</h1>

</body>
</html>